package com.design.mediator.smartcontrol;

public class MediatorSmartHomeDemo {
    public static void main(String[] args) {
        SmartHomeControlCenter controlCenter = new SmartHomeControlCenter();

        SmartLight smartLight = new SmartLight(controlCenter);
        SmartThermostat smartThermostat = new SmartThermostat(controlCenter);
        SmartSoundSystem smartSoundSystem = new SmartSoundSystem(controlCenter);

        controlCenter.setSmartLight(smartLight);
        controlCenter.setSmartThermostat(smartThermostat);
        controlCenter.setSmartSoundSystem(smartSoundSystem);

        // Simulate "Leaving Home" mode
        controlCenter.turnOffLights();
        controlCenter.adjustTemperature();
        controlCenter.turnOffSoundSystem();
    }
}
